<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.sino.uam.entity.UserInfo" %>
<%@ include file="../include/taglib.jsp"%>

<%
    response.setHeader("Cache-Control", "no-store");
	response.setHeader("Pragrma", "no-cache");
	response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>通知测试页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<%@ include file="../include/common.jsp"%>

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/sub_menu.css" />

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/selfmainten/tool.css" />
	
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/jsframework.js"></script>

<script type=text/javascript>
	function sendSmsMsg(){
		 $.ajax({
			   type: "POST", 
			   url: '${pageContext.request.contextPath}/selfmainten/tool!sendSmsMsg.action', //请求的action
			   data: {
				   mobile:$('#mobile').val(),
				   msg :$('#msg').val()
			   },
			   dataType: 'json',
			   success: function(data){ //结果
				   $('#tip').text('消息已发送 ，请在30S内查收。');
			   }
		});
	}
	
	function sendEmailMsg(){
		var probe = $('#probeId option:selected').val();
		var isChecked = $('#pool').is(':checked');
		 $.ajax({
			   type: "POST", 
			   url: '${pageContext.request.contextPath}/selfmainten/tool!sendEmailMsg.action', //请求的action
			   data: {
				   eamil:'asia55555@126.com',
				   msg :$('#cmd').val()
			   },
			   dataType: 'json',
			   success: function(data){ //结果
				   $('#result').val(data.result);
			   }
		});
	}
	
	function changeUser(){
		var muser = $('#mobileUser').attr('value');
		$('#mobile').val(muser);
	}
	
	$(function(){
		$('#msg').blur(function(){
			var msgt = $('#msg').val();
			  if(msgt == null || msgt ==''){
				  $('#msg').text('您好,此为BSM发出的测试消息.');
			  }
		  });
	});
</script>
</head>
<body>
	<div class="searchFormStyle search" >
		<span class="search-span">
  		    <label >手 机 号：</label>
  			<input type="text" id="mobile" name="mobile" class="search-input" value="15210068984"/>
    	</span>
   		<span class="search-span">
   		    <label >直接选择用户：</label>
  		    <select id="mobileUser" name = "mobileUser"   class = "select search-input"  onchange="changeUser();">
	    		  <option value="">---- 选择用户 ----</option>
	    		  <%
   						List<UserInfo> userList = (List<UserInfo>)request.getAttribute("users");
   						for(UserInfo  p : userList){
 	    			    	   out.println("<option value='"+p.getMobileTel()+"'>"+p.getFullName()+"</option>");
   						}
   			      %>
	    	</select>
	    </span>
	</div>
	
	<!--
	<div class="searchFormStyle search" >
		<span class="search-span">
  		    <label >邮箱地址：</label>
  			<input type="text" id="email" name="email" class="search-input" value="asia55555@126.com" >
    	</span>
   		<span class="search-span">
   		    <label >直接选择用户：</label>
  			<input type="text" id="pwd" name="pwd"  class="search-input" >
	    </span>
	   
	</div>
	  -->
	<div class="searchFormStyle search" >
		<span class="search-span">
  		    <label >消息内容：</label>
    	</span>
	</div>
	<div class="searchFormStyle search" >
		 <label>&nbsp;</label>
	 	 <textarea style="width: 720px;height: 80px;"  id="msg" name="msg" >您好,此为BSM发出的测试消息.</textarea>
	</div>
	
	<div class="searchFormStyle search" >
		<span class="search-span">
  		    <label >提示：</label>
  		    <label id="tip" color="#0000ff">建议不要频繁发送测试消息。</label>
    	</span>
	</div>
	<div class="searchFormStyle search" >
		  <span class="search-span">
	 		<input type="button" value="发送短信" class="btn-4 btn-h" onclick="sendSmsMsg();"/>
	 		<!--  
	 		<input type="button" value="发送邮件" class="btn-4 btn-h" onclick="sendMsg();"/>
	 		-->
	    </span>
	</div>
</body>
</html>